package tt.dz.biz.job;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import tt.dz.biz.service.batchpay.LiabilitiesService;
import tt.dz.common.AppContxtUtil;
import tt.dz.common.DzConstants;
import tt.dz.common.DzConstants.sysJob;
import tt.dz.common.LogUtil;

public class DebtStatisticsJob
  extends AbstractJob
{
  protected void executeJob(JobExecutionContext context)
    throws JobExecutionException
  {
    LiabilitiesService liabilitiesService = (LiabilitiesService)AppContxtUtil.getBean("liabilitiesService");
    try
    {
      LogUtil.info("统计平台上月应付账款开始");
      liabilitiesService.saveMerchantLiabilities();
      LogUtil.info("统计平台上月应付账款结束");
    }
    catch (Exception e)
    {
      LogUtil.error("生成运营商应付款数据异常", e);
    }
  }
  
  protected String getJobCode()
  {
    return DzConstants.sysJob.DEBTSTATISTICS_JOB.value();
  }
}
